﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZL.WeChatCard.Entity;
using ZL.WeChatCard.Entity.EasyUse;
using ZL.WeChatCard.Service.Base;
using ZL.WeChatCard.Service.InterFace;
using ZL.WeChatCard.Utility;

namespace ZL.WeChatCard.Service.EasyUse
{
    public class ChargeService : ServiceBase, IChargeService
    {
        public ZzinfocsResponse GetChargeInfo()
        {
            var url = $"{server}/Api/EasyUse/ChargeInfo";
            ZzinfocsResponse scc = httpClient.HttpGet<ZzinfocsResponse>(url, Identity);
            return scc; 
        }

        public AccCzResponse PreCharge(ThrywInfo ywInfo)
        {
            var url = $@"{server}/Api/EasyUse/PreCharge";
            AccCzResponse scc = httpClient.HttpPost<ThrywInfo, AccCzResponse>(ywInfo,url, Identity);
            return scc;
        }

        public Thrpaylog ChargeNewSave(Thrpaylog log)
        {
            var url = $@"{server}/Api/EasyUse/ChargeNewSave";
            Thrpaylog tlog = httpClient.HttpPost<Thrpaylog, Thrpaylog>(log,url, Identity);
            return tlog;
        }

        public Thrpaylog ChargeModifySave(Thrpaylog log)
        {
            var url = $@"{server}/Api/EasyUse/ChargeModifySave";
            Thrpaylog tlog = httpClient.HttpPost<Thrpaylog, Thrpaylog>(log, url, Identity);
            return tlog;
        }

        public Result ChargeResultQuery(QueryParam prarm)
        {
            var url = $@"{server}/Api/EasyUse/ChargeResultQuery";
            Result tlog = httpClient.HttpPost<QueryParam,Result>(prarm, url, Identity);
            return tlog;
        }

        public ResponseResultInfo ChargeCancel(string pno, string pnopwd)
        {
            var url = $@"{server}/Api/EasyUse/ChargeCancel?pno={pno}&&pnopwd={pnopwd}";
            ResponseResultInfo result = httpClient.HttpGet<ResponseResultInfo>(url, Identity);
            return result;
        }

    }
}
